
# FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OSGGIS)
    ADD_DEFINITIONS(-DOSGGIS_LIBRARY -DOSGGIS_EXPORTS)
ELSE (DYNAMIC_OSGGIS)
    ADD_DEFINITIONS(-DOSGGIS_LIBRARY_STATIC -DOSGGIS_EXPORTS_STATIC)
ENDIF(DYNAMIC_OSGGIS)

SET(LIB_NAME osgGIS)

SET(LIB_PUBLIC_HEADERS
    AlignFilter
    Attribute
    AttributedNode
    AttributeIndex
    AutoResetBlock
    BufferFilter
    BuildGeomFilter
    BuildLabelsFilter
    BuildNodesFilter
    ChangeShapeTypeFilter
    ClampFilter
    CollectionFilter
    CollectionFilterState
    Common
    ConvexHullFilter
    CombineLinesFilter
    CropFilter
    DecimateFilter
    DefaultFeatureStoreFactory
    DefaultRasterStoreFactory
    DensifyFilter
    ElevationGrid
    ElevationResource
    Ellipsoid
    Export
    ExtrudeGeomFilter
    FadeHelper
    Feature
    FeatureCursor
    FeatureFilter
    FeatureFilterState
    FeatureLayer
    FeatureLayerCompiler
    FeatureLayerResource
    FeatureStore
    FeatureStoreCompiler
    FeatureStoreFactory
    Filter
    FilterGraph
    FilterState
    FilterEnv
    Fragment
    FragmentFilter
    FragmentFilterState
    GDAL_RasterStore
    GeocentricSpatialReference
    GeoExtent
    GeometryCleaner
    GeoPoint
    GeoShape
    GriddedLayerCompiler
    GroupFilter
    ImageUtils
    LayerCompiler
    LineSegmentIntersector2
    LocalizeNodesFilter
    Lua_ScriptEngine
    Lua_ScriptEngine_tolua
    ModelResource
    NodeFilter
    NodeFilterState
    Notify
    OGR_Feature
    OGR_FeatureStore
    OGR_SpatialReference
    OGR_SpatialReferenceFactory
    OGR_Utils
    OptimizerHints
    PagedLayerCompiler
    PathResource
    Property
    RandomGroupingFilter
    RasterResource
    RasterStore
    RasterStoreFactory
    RecalculateExtentFilter
    Registry
    RemoveHolesFilter
    Report
    Resource
    ResourceCache
    ResourceLibrary
    ResourcePackager
    RTree
    RTreeSpatialIndex
    Script
    ScriptEngine
    SelectFilter
    Session
    SkinResource
    SimpleFeature
    SimpleLayerCompiler
    SimpleSpatialIndex
    SmartReadCallback
    SpatialIndex
    SpatialReference
    SpatialReferenceBase
    SpatialReferenceFactory
    SRSResource
    StubSpatialIndex
    SubstituteModelFilter
    Tags
    Task
    TaskManager
    TerrainUtils
    TransformFilter
    Units
    Utils
    WriteFeaturesFilter
    WriteTextFilter
)

ADD_LIBRARY(${LIB_NAME}
    ${OSGGIS_USER_DEFINED_DYNAMIC_OR_STATIC}
    ${LIB_PUBLIC_HEADERS}
    AlignFilter.cpp
    Attribute.cpp
    AttributedNode.cpp
    BufferFilter.cpp
    BuildGeomFilter.cpp
    BuildLabelsFilter.cpp
    BuildNodesFilter.cpp
    ChangeShapeTypeFilter.cpp
    ClampFilter.cpp
    CollectionFilter.cpp
    CollectionFilterState.cpp
    CombineLinesFilter.cpp
    ConvexHullFilter.cpp
    CropFilter.cpp
    DecimateFilter.cpp
    DefaultFeatureStoreFactory.cpp
    DefaultRasterStoreFactory.cpp
    DensifyFilter.cpp
    ElevationResource.cpp
    Ellipsoid.cpp
    ExtrudeGeomFilter.cpp
    FadeHelper.cpp
    Feature.cpp
    FeatureCursor.cpp
    FeatureFilter.cpp
    FeatureFilterState.cpp
    FeatureLayer.cpp
    FeatureLayerCompiler.cpp
    FeatureLayerResource.cpp
    FeatureStoreCompiler.cpp
    Filter.cpp
    FilterGraph.cpp
    FilterState.cpp
    FilterEnv.cpp    
    Fragment.cpp
    FragmentFilter.cpp
    FragmentFilterState.cpp
    GDAL_RasterStore.cpp
    GeocentricSpatialReference.cpp
    GeoExtent.cpp
    GeometryCleaner.cpp
    GeoPoint.cpp
    GeoShape.cpp
    GriddedLayerCompiler.cpp
    GroupFilter.cpp
    ImageUtils.cpp
    LayerCompiler.cpp
    LineSegmentIntersector2.cpp
    LocalizeNodesFilter.cpp
    Lua_ScriptEngine.cpp
    Lua_ScriptEngine_tolua.cpp
    ModelResource.cpp
    NodeFilter.cpp
    NodeFilterState.cpp
    Notify.cpp
    OGR_Feature.cpp
    OGR_FeatureStore.cpp
    OGR_SpatialReference.cpp
    OGR_SpatialReferenceFactory.cpp
    OGR_Utils.cpp
    OptimizerHints.cpp
    PagedLayerCompiler.cpp
    PathResource.cpp
    Property.cpp
    RandomGroupingFilter.cpp
    RasterResource.cpp
    RecalculateExtentFilter.cpp
    Registry.cpp
    RemoveHolesFilter.cpp
    Report.cpp
    Resource.cpp
    ResourceCache.cpp
    ResourceLibrary.cpp
    ResourcePackager.cpp
    RTreeSpatialIndex.cpp
    Script.cpp
    SelectFilter.cpp
    Session.cpp
    SkinResource.cpp
    SimpleFeature.cpp
    SimpleLayerCompiler.cpp
    SimpleSpatialIndex.cpp
    SmartReadCallback.cpp
    SpatialReference.cpp
    SRSResource.cpp
    SubstituteModelFilter.cpp
    Task.cpp
    TaskManager.cpp
    TerrainUtils.cpp
    TransformFilter.cpp
    Units.cpp
    Utils.cpp
    WriteFeaturesFilter.cpp
    WriteTextFilter.cpp
)

LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT}    ${MATH_LIBRARY})
LINK_WITH_VARIABLES(${LIB_NAME} OSG_LIBRARY OSGUTIL_LIBRARY OSGDB_LIBRARY OSGFX_LIBRARY OSGSIM_LIBRARY OSGTEXT_LIBRARY OPENTHREADS_LIBRARY GDAL_LIBRARY LUA_LIBRARY TOLUA_LIBRARY)
LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} )

INCLUDE(ModuleInstall OPTIONAL)
